Optimal. Leaf size=198 \[ \frac {7 a^4 (4 A+5 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^4 (83 A+100 B) \tan (c+d x)}{15 d}+\frac {a^4 (244 A+275 B) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.37, antiderivative size = 198, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {3054, 3047,
3100, 2827, 3852, 8, 3855} \begin {gather*} \frac {a^4 (83 A+100 B) \tan (c+d x)}{15 d}+\frac {7 a^4 (4 A+5 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^4 (244 A+275 B) \tan (c+d x) \sec (c+d x)}{120 d}+\frac {(26 A+25 B) \tan (c+d x) \sec ^2(c+d x) \left (a^4 \cos (c+d x)+a^4\right )}{30 d}+\frac {(8 A+5 B) \tan (c+d x) \sec ^3(c+d x) \left (a^2 \cos (c+d x)+a^2\right )^2}{20 d}+\frac {a A \tan (c+d x) \sec ^4(c+d x) (a \cos (c+d x)+a)^3}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2827
Rule 3047
Rule 3054
Rule 3100
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^4 (A+B \cos (c+d x)) \sec ^6(c+d x) \, dx &=\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{5} \int (a+a \cos (c+d x))^3 (a (8 A+5 B)+a (A+5 B) \cos (c+d x)) \sec ^5(c+d x) \, dx\\ &=\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{20} \int (a+a \cos (c+d x))^2 \left (2 a^2 (26 A+25 B)+a^2 (12 A+25 B) \cos (c+d x)\right ) \sec ^4(c+d x) \, dx\\ &=\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{60} \int (a+a \cos (c+d x)) \left (a^3 (244 A+275 B)+a^3 (88 A+125 B) \cos (c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{60} \int \left (a^4 (244 A+275 B)+\left (a^4 (88 A+125 B)+a^4 (244 A+275 B)\right ) \cos (c+d x)+a^4 (88 A+125 B) \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac {a^4 (244 A+275 B) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{120} \int \left (8 a^4 (83 A+100 B)+105 a^4 (4 A+5 B) \cos (c+d x)\right ) \sec ^2(c+d x) \, dx\\ &=\frac {a^4 (244 A+275 B) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{8} \left (7 a^4 (4 A+5 B)\right ) \int \sec (c+d x) \, dx+\frac {1}{15} \left (a^4 (83 A+100 B)\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {7 a^4 (4 A+5 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^4 (244 A+275 B) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}-\frac {\left (a^4 (83 A+100 B)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{15 d}\\ &=\frac {7 a^4 (4 A+5 B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^4 (83 A+100 B) \tan (c+d x)}{15 d}+\frac {a^4 (244 A+275 B) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {(26 A+25 B) \left (a^4+a^4 \cos (c+d x)\right ) \sec ^2(c+d x) \tan (c+d x)}{30 d}+\frac {(8 A+5 B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a A (a+a \cos (c+d x))^3 \sec ^4(c+d x) \tan (c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.69, size = 306, normalized size = 1.55 \begin {gather*} -\frac {a^4 (1+\cos (c+d x))^4 \sec ^8\left (\frac {1}{2} (c+d x)\right ) \sec ^5(c+d x) \left (1680 (4 A+5 B) \cos ^5(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-\sec (c) (80 (59 A+64 B) \sin (d x)-960 (2 A+3 B) \sin (2 c+d x)+1320 A \sin (c+2 d x)+930 B \sin (c+2 d x)+1320 A \sin (3 c+2 d x)+930 B \sin (3 c+2 d x)+3200 A \sin (2 c+3 d x)+3520 B \sin (2 c+3 d x)-120 A \sin (4 c+3 d x)-480 B \sin (4 c+3 d x)+420 A \sin (3 c+4 d x)+405 B \sin (3 c+4 d x)+420 A \sin (5 c+4 d x)+405 B \sin (5 c+4 d x)+664 A \sin (4 c+5 d x)+800 B \sin (4 c+5 d x))\right )}{30720 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 303, normalized size = 1.53
method | result | size |
derivativedivides | \(\frac {A \,a^{4} \tan \left (d x +c \right )+a^{4} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 A \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} B \tan \left (d x +c \right )-6 A \,a^{4} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+6 a^{4} B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 A \,a^{4} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-4 a^{4} B \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )-A \,a^{4} \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )+a^{4} B \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(303\) |
default | \(\frac {A \,a^{4} \tan \left (d x +c \right )+a^{4} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 A \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} B \tan \left (d x +c \right )-6 A \,a^{4} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+6 a^{4} B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 A \,a^{4} \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-4 a^{4} B \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )-A \,a^{4} \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )+a^{4} B \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(303\) |
risch | \(-\frac {i a^{4} \left (420 A \,{\mathrm e}^{9 i \left (d x +c \right )}+405 B \,{\mathrm e}^{9 i \left (d x +c \right )}-120 A \,{\mathrm e}^{8 i \left (d x +c \right )}-480 B \,{\mathrm e}^{8 i \left (d x +c \right )}+1320 A \,{\mathrm e}^{7 i \left (d x +c \right )}+930 B \,{\mathrm e}^{7 i \left (d x +c \right )}-1920 A \,{\mathrm e}^{6 i \left (d x +c \right )}-2880 B \,{\mathrm e}^{6 i \left (d x +c \right )}-4720 A \,{\mathrm e}^{4 i \left (d x +c \right )}-5120 B \,{\mathrm e}^{4 i \left (d x +c \right )}-1320 A \,{\mathrm e}^{3 i \left (d x +c \right )}-930 B \,{\mathrm e}^{3 i \left (d x +c \right )}-3200 A \,{\mathrm e}^{2 i \left (d x +c \right )}-3520 B \,{\mathrm e}^{2 i \left (d x +c \right )}-420 A \,{\mathrm e}^{i \left (d x +c \right )}-405 B \,{\mathrm e}^{i \left (d x +c \right )}-664 A -800 B \right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {7 A \,a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{8 d}-\frac {7 A \,a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}-\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{8 d}\) | \(311\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 376 vs.
\(2 (186) = 372\).
time = 0.27, size = 376, normalized size = 1.90 \begin {gather*} \frac {16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} A a^{4} + 480 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{4} + 320 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{4} - 60 \, A a^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 15 \, B a^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 240 \, A a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 360 \, B a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 120 \, B a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 240 \, A a^{4} \tan \left (d x + c\right ) + 960 \, B a^{4} \tan \left (d x + c\right )}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 165, normalized size = 0.83 \begin {gather*} \frac {105 \, {\left (4 \, A + 5 \, B\right )} a^{4} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 105 \, {\left (4 \, A + 5 \, B\right )} a^{4} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (83 \, A + 100 \, B\right )} a^{4} \cos \left (d x + c\right )^{4} + 15 \, {\left (28 \, A + 27 \, B\right )} a^{4} \cos \left (d x + c\right )^{3} + 16 \, {\left (17 \, A + 10 \, B\right )} a^{4} \cos \left (d x + c\right )^{2} + 30 \, {\left (4 \, A + B\right )} a^{4} \cos \left (d x + c\right ) + 24 \, A a^{4}\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.50, size = 246, normalized size = 1.24 \begin {gather*} \frac {105 \, {\left (4 \, A a^{4} + 5 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 105 \, {\left (4 \, A a^{4} + 5 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (420 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 525 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 1960 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 2450 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 3584 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4480 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3160 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3950 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 1500 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1395 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.79, size = 224, normalized size = 1.13 \begin {gather*} \frac {7\,a^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (4\,A+5\,B\right )}{4\,d}-\frac {\left (7\,A\,a^4+\frac {35\,B\,a^4}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (-\frac {98\,A\,a^4}{3}-\frac {245\,B\,a^4}{6}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {896\,A\,a^4}{15}+\frac {224\,B\,a^4}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {158\,A\,a^4}{3}-\frac {395\,B\,a^4}{6}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (25\,A\,a^4+\frac {93\,B\,a^4}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________